﻿<Gui:XCaseGridBase x:Class="XCase.Gui.AppearanceGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Gui="clr-namespace:XCase.Gui" HorizontalContentAlignment="Left">
    <Grid Margin="5,0,5,0" Name="grid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"  />
            <RowDefinition Height="Auto"  />
            <RowDefinition Height="Auto"  />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Name="firstColumn" Width="60" MaxWidth="60"/>
            <ColumnDefinition Name="secondColumn" MinWidth="62" />
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Gui:WidthConverter x:Key="widthConverter"/>
            <Gui:HeightConverter x:Key="heightConverter"/>
            <Gui:XConverter x:Key="xConverter"/>
            <Gui:YConverter x:Key="yConverter"/>
        </Grid.Resources>

        <!-- Width -->
        <TextBox Grid.Row="0"  Grid.Column="0" IsReadOnly="True" Focusable="False" >
            Width
        </TextBox>
        <TextBox Name="widthBox" Grid.Row="0" Grid.Column="1"
                     Text="{Binding Path=Width, Converter={StaticResource widthConverter}}" 
                     KeyUp="KeyPressed_Up"                     
                     KeyDown="KeyPressed_Down" 
                     LostFocus="ForceNumValue" />
        <!-- Height -->
        <TextBox Grid.Row="1"  Grid.Column="0" IsReadOnly="True" Focusable="False">
            Height
        </TextBox>
        <TextBox Name="heightBox" Grid.Row="1" Grid.Column="1" 
                     Text="{Binding Path=Height, Converter={StaticResource heightConverter}}" 
                     KeyUp="KeyPressed_Up"                     
                     KeyDown="KeyPressed_Down"                
                     LostFocus="ForceNumValue" />
        <!-- X -->
        <TextBox Grid.Row="2"  Grid.Column="0" IsReadOnly="True" Focusable="False">
            X
        </TextBox>
        <TextBox Name="xBox" Grid.Row="2" Grid.Column="1"  
                     Text="{Binding Path=X, Converter={StaticResource xConverter}}" 
                     KeyUp="KeyPressed_Up"                     
                     KeyDown="KeyPressed_Down" 
                     LostFocus="ForcePositiveNumValue"/>
        <!-- Y -->
        <TextBox Grid.Row="3"  Grid.Column="0" IsReadOnly="True" Focusable="False">
            Y
        </TextBox>
        <TextBox Name="yBox" Grid.Row="3" Grid.Column="1"  
                     Text="{Binding Path=Y, Converter={StaticResource yConverter}}" 
                     KeyUp="KeyPressed_Up"                     
                     KeyDown="KeyPressed_Down" 
                     LostFocus="ForcePositiveNumValue" />
    </Grid>
</Gui:XCaseGridBase>
